package cn.itcast.stream;

import java.util.stream.Stream;

/**
 * 
 * @author LENOVO
 * cancat将两个流合并成一个流
 */
public class Stream_Concat {
	
	public static void main(String[] args) {
		Stream<Integer> of = Stream.of(1,2);
		Stream<Integer> of2 = Stream.of(3,4);
		//合并成新流
		Stream.concat(of, of2).forEach(i->{System.out.println(i);});
	}
}
